// 2023/1/17

async function run() {
  await wait(10000);
  console.log('done');
}

async function wait(interval) {
  return new Promise((resolve) => setTimeout(() => resolve(), interval));
}

async function exec() {
  for (let i = 0; i < 10; i++) {
    await wait(1000);
    console.log(i);
  }
}

(async function main() {

  const promise = exec();

  await run();

  await promise;


})();

